﻿@{
    Layout = null;
    List<EnterpriseFund.Model.FinanceProp> financePropList = (ViewData["FinancePropList"] == null ? new List<EnterpriseFund.Model.FinanceProp>() : ViewData["FinancePropList"] as List<EnterpriseFund.Model.FinanceProp>);
}
@model System.Collections.IEnumerable
<!DOCTYPE html>
<html>
<head>
    <title>资金拨付查询</title>
    @if (false)
    {
    
        <script src="../../Scripts/jquery-vsdoc.js" type="text/javascript"></script>
        <script src="../../Scripts/ASPxScriptIntelliSense.js" type="text/javascript"></script>
    }
    <link href="@Url.Content("~/Content/Site.css", true)" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/json2.js", true)" type="text/javascript"></script>
    <script src="@Url.Content("~/Common/GetRootPath.ashx", true)" type="text/javascript"></script>
    @Html.DevExpress().GetStyleSheets(
                new StyleSheet { ExtensionType = ExtensionType.GridView, Theme = DevExpressHelper.Theme },
                new StyleSheet { ExtensionType = ExtensionType.DropDownEdit, Theme = DevExpressHelper.Theme },
                new StyleSheet { ExtensionType = ExtensionType.ComboBox, Theme = DevExpressHelper.Theme }
)
    @Html.DevExpress().GetStyleSheets(

        new StyleSheet { ExtensionType = ExtensionType.ListBox, Theme = DevExpressHelper.Theme }
)
    @Html.DevExpress().GetStyleSheets(

        new StyleSheet { ExtensionType = ExtensionType.TextBox, Theme = DevExpressHelper.Theme }
)
    <script src="@Url.Content("~/Scripts/checkinput.js")" type="text/javascript"></script>
    <style>
        #form_query
        {
        }
        .hide
        {
            display: none;
        }
        input, select
        {
            border: 1px solid #aecaf0;
        }
        input.txt, select.txt
        {
            width: 99%;
        }
        input.btn
        {
            padding: 3px 10px 2px;
            border: #a3c0e8 1px solid;
            background: #e2f0ff url(/EnterpriseFund/DXR.axd?r=0_54) repeat-x 50% top;
            color: #2c4d79;
            cursor: pointer;
        }
        input.btn:hover
        {
            background-image: url(/EnterpriseFund/DXR.axd?r=0_57);
        }
        th
        {
            text-align: right;
        }
    </style>
    <script type="text/javascript">
        var rootUrl = '@Url.Content("~/QueryAllowancePay/")';
        function OnBeginCallback(s, e) {
            e.customArgs["command"] = e.command;


            var nsrsbh = $("#hnsrsbh").val();

            var nsrbm = $("#hnsrbm").val();
            var nsrmc = $("#hnsrmc").val();
            var FFinance = $("#hFFinance").val();

            var FAmount1 = $("#hFAmount1").val();
            var FAmount2 = $("#hFAmount2").val();
            var FFileNo = $("#hFFileNo").val();
            var FNote = $("#hFNote").val();
            var FPayDateBegin = $("#hFPayDateBegin").val();
            var FPayDateEnd = $("#hFPayDateEnd").val();


            e.customArgs["Nsrsbh"] = nsrsbh;
            e.customArgs["Nsrbm"] = nsrbm;
            e.customArgs["Nsrmc"] = nsrmc;
            e.customArgs["FFinance"] = FFinance;
            e.customArgs["FAmount1"] = FAmount1;
            e.customArgs["FAmount2"] = FAmount2;
            e.customArgs["FFileNo"] = FFileNo;
            e.customArgs["FNote"] = FNote;
            e.customArgs["FPayDateBegin"] = FPayDateBegin;
            e.customArgs["FPayDateEnd"] = FPayDateEnd;
            //  e.customArgs[""] = ;

            //     alert(1);
        }

        //查询
        function search() {

            $("#hnsrsbh").val(NSRSBH1.GetText());
            $("#hnsrbm").val(NSRBM1.GetText());
            $("#hnsrmc").val(NSRMC1.GetText());
            $("#hFFinance").val(FFinance1.GetValue());
            $("#hFAmount1").val(FAmount1.GetText());
            $("#hFAmount2").val(FAmount2.GetText());
            $("#hFFileNo").val(FFileNo1.GetText());
            $("#hFNote").val(FNote1.GetText());
            if (FPayDateBegin1.GetDate() != null) {
                $("#hFPayDateBegin").val(FPayDateBegin1.GetText());
            }
            else {
                $("#hFPayDateBegin").val("");
            }
            if (FPayDateEnd1.GetDate() != null) {
                $("#hFPayDateEnd").val(FPayDateEnd1.GetText());
            }
            else {
                $("#hFPayDateEnd").val("");
            }
            //              var fspecialAdjustName = FSpecialAdjustName.GetValue();
            //               var rKRQBeginDate = RKRQBeginDate.GetValue();
            //                var rKRQEndDate = RKRQEndDate.GetValue();
            // if (CheckValues())
            if ((!isNaN(FAmount1.GetText())) & (!isNaN(FAmount2.GetText()))) {
                $("#hsearched").val("T");
                gvEditing.Refresh();
            }
            else if (FAmount1.GetText() == "" & FAmount2.GetText() == "") {
                $("#hsearched").val("T");
                gvEditing.Refresh();
            }
            else {
                $("#hFAmount1").val("");
                $("#hFAmount2").val("");
                alert("拨款金额输入必须为数字,且不为空");
            }


        }


        //重置
        function undo() {

            //            $("#nsrsbh").val("");
            //            $("#nsrbm").val("");
            //            $("#nsrmc").val("");
            //            $("#fIssueNo").val("");
            //             NSRSBH1.val("");
            NSRSBH1.SetText("");
            NSRBM1.SetText("");
            NSRMC1.SetText("");
            FFinance1.SetValue("");

            FAmount1.SetText("");
            FAmount2.SetText("");
            FFileNo1.SetText("");
            FNote1.SetText("");
            FPayDateBegin1.SetText("");
            FPayDateEnd1.SetText("");

        
        }

        function MenuTop_emClick(source, e) {
            switch (e.item.name) {
                case "btnExcel":
                    {
                        if ($("#hsearched").val() == "T") {
                            //if (CheckValues())
                            form_query.target = '_self';
                            form_query.action = rootPath + "/QueryAllowancePay/ExportToXls";
                            form_query.submit();
                        }
                        break;


                    }
                case "btnReport":
                    {
                        if ($("#hsearched").val() == "T") {
                            window.showModalDialog(rootPath + "/QueryAllowancePay/Print", window, "dialogWidth=800px;dialogHeight=500px");
                        }
                        //if (CheckValues())
                        //                        form_query.target = '_blank';
                        //                        //  form_query.target = 'parent.contentframe';
                        //                        //  parent.contentframe.url(
                        //                        form_query.action = rootPath + "/QueryAllowancePay/Print";
                        //                        form_query.submit();
                        break;


                    }

                case "btnGridShow":
                    {
                        gvEditing.ShowCustomizationWindow();
                        break;
                    }

            }
        }

        function keyPress() {
            if (event.keyCode && event.keyCode == 13) {
                search();

            }

        }
    </script>
</head>
<body onkeypress="keyPress()">
    @Html.Partial("LoadPanelPartial")
    @Html.DevExpress().Menu(settings =>
{
    settings.Name = "toolBarMenu";
    settings.ItemAutoWidth = false;
    settings.Width = System.Web.UI.WebControls.Unit.Percentage(100);
    settings.Styles.Style.Border.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(0);
    settings.Styles.Style.BorderTop.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(1);
    settings.Items.Add(item =>
    {
        item.Name = "btnExcel";
        item.Text = "导出Excel";
        item.Image.Url = Url.Content("~/Content/ControlImages/excel.png");
    });
    settings.Items.Add(item =>
    {
        item.Name = "btnReport";
        item.Text = "打印";
        item.Image.Url = Url.Content("~/Content/icons/print.png");
    });

    settings.Items.Add(item =>
    {
        item.Name = "btnGridShow";
        item.Text = "选择列";
        item.Image.Url = Url.Content("~/Content/FunctionImages/AllowanceFileAudit.png");
    });

    settings.ClientSideEvents.ItemClick = "function(source,e){MenuTop_emClick(source,e)}";
    settings.ItemLinkMode = ItemLinkMode.ContentBounds;
}).GetHtml()
    @using (Html.BeginForm("ExportToXls", "QueryAllowancePay", FormMethod.Post, new { id = "form_query" }))
    {
      
        <table class="query" width="800px" style="margin-left: auto; margin-right: auto">
            <tr>
                <td align="right">
                    纳税人编码：
                </td>
                <td>
                    @Html.DevExpress().TextBox(settings =>
               {
                   settings.Name = "NSRBM1";
                   settings.Width = System.Web.UI.WebControls.Unit.Pixel(100);
               }).Bind(ViewBag.nsrbm).GetHtml()
                </td>
                <td align="right">
                    拨款金额：
                </td>
                <td>
                    <table cellpadding='0' cellspacing='0' border='0'>
                        <tr>
                            <td>
                                @Html.DevExpress().TextBox(settings =>
               {
                   settings.Name = "FAmount1";
                   settings.Width = System.Web.UI.WebControls.Unit.Pixel(100);
               }).Bind(ViewBag.FAmount).GetHtml()
                            </td>
                            <td align="center">
                                -
                            </td>
                            <td>
                                @Html.DevExpress().TextBox(settings =>
               {
                   settings.Name = "FAmount2";
                   settings.Width = System.Web.UI.WebControls.Unit.Pixel(100);
               }).Bind(ViewBag.FAmount2).GetHtml()
                            </td>
                        </tr>
                    </table>
                </td>
                <td align="right">
                    资金性质：
                </td>
                <td>
                    @Html.DevExpress().ComboBox(settings =>
               {
                   settings.Name = "FFinance1";
                   settings.Width = System.Web.UI.WebControls.Unit.Pixel(100);
                   settings.Properties.TextField = "FFinancePropShortName";
                   settings.Properties.ValueField = "FFinancePropNo";
                   settings.Properties.IncrementalFilteringMode = IncrementalFilteringMode.StartsWith;
                   settings.Properties.DropDownStyle = DropDownStyle.DropDown;
                   //settings.Properties.ClientSideEvents.SelectedIndexChanged = "Changed";

               }).BindList(ViewData["FinancePropList"]).Bind(ViewBag.FFinance).GetHtml()
                </td>
                <td>
                    <table>
                        <tr>
                            <td>
                                @Html.DevExpress().Button(settings =>
                           {
                               settings.Name = "btnSearch";
                               settings.Text = "查询";
                               //settings.Height = System.Web.UI.WebControls.Unit.Pixel(20);
                               //settings.Width = System.Web.UI.WebControls.Unit.Pixel(100);
                               settings.ControlStyle.CssClass = "button";
                               settings.Images.Image.Url = Url.Content("~/Content/ControlImages/search.png");
                               settings.ClientSideEvents.Click = "search";
                           }).GetHtml()
                            </td>
                            <td>
                                @Html.DevExpress().Button(settings =>
                           {
                               settings.Name = "btnUndo";
                               settings.Text = "重置";
                               //settings.Height = System.Web.UI.WebControls.Unit.Pixel(20);
                               //settings.Width = System.Web.UI.WebControls.Unit.Pixel(100);
                               settings.ControlStyle.CssClass = "button";
                               settings.Images.Image.Url = Url.Content("~/Content/ControlImages/undo_blue.png");
                               settings.ClientSideEvents.Click = "undo";
                           }).GetHtml()
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td align="right">
                    纳税人名称：
                </td>
                <td>
                    @Html.DevExpress().TextBox(settings =>
               {
                   settings.Name = "NSRMC1";
                   settings.Width = System.Web.UI.WebControls.Unit.Pixel(100);
               }).Bind(ViewBag.nsrmc).GetHtml()
                </td>
                <td align="right">
                    拨付日期：
                </td>
                <td>
                    <table cellpadding='0' cellspacing='0' border='0'>
                        <tr>
                            <td>
                                @Html.DevExpress().DateEdit(settings =>
                               {
                                   settings.Name = "FPayDateBegin1";
                                   settings.Width = System.Web.UI.WebControls.Unit.Pixel(100);
                                   settings.Properties.ShowShadow = true;
                                   settings.Properties.EditFormat = EditFormat.Date;
                                   settings.Properties.EditFormatString = "yyyy-MM-dd";
                                   settings.Properties.MinDate = DateTime.Parse("1900-01-01");
                                   settings.Properties.UseMaskBehavior = true;
                                   settings.Properties.NullText = "";
                                   // settings.Properties.GetDisplayText
                                   settings.Properties.MinDate = DateTime.Parse("1900/01/01");
                               }).Bind(ViewBag.FPayDateBegin).GetHtml()
                            </td>
                            <td>
                                -
                            </td>
                            <td>
                                @Html.DevExpress().DateEdit(settings =>
                               {
                                   settings.Name = "FPayDateEnd1";
                                   settings.Width = System.Web.UI.WebControls.Unit.Pixel(100);
                                   settings.Properties.ShowShadow = true;
                                   settings.Properties.EditFormat = EditFormat.Date;
                                   settings.Properties.EditFormatString = "yyyy-MM-dd";
                                   settings.Properties.MinDate = DateTime.Parse("1900-01-01");
                                   settings.Properties.UseMaskBehavior = true;
                                   settings.Properties.NullText = "";
                                   settings.Properties.MinDate = DateTime.Parse("1900/01/01");
                               }).Bind(ViewBag.FPayDateEnd).GetHtml()
                            </td>
                        </tr>
                    </table>
                </td>
                <td align="right">
                    文件号：
                </td>
                <td>
                    @Html.DevExpress().TextBox(settings =>
                {
                    settings.Name = "FFileNo1";
                    settings.Width = System.Web.UI.WebControls.Unit.Pixel(100);
                }).Bind(ViewBag.FFileNo).GetHtml()
                </td>
            </tr>
            <tr>
                <td align="right">
                    备注：
                </td>
                <td>
                    @Html.DevExpress().TextBox(settings =>
                 {
                     settings.Name = "FNote1";
                     settings.Width = System.Web.UI.WebControls.Unit.Pixel(100);
                 }).Bind(ViewBag.FNote).GetHtml()
                </td>
                <td align="right">
                    纳税人识别号：
                </td>
                <td>
                    @Html.DevExpress().TextBox(settings =>
               {
                   settings.Name = "NSRSBH1";
                   settings.Width = System.Web.UI.WebControls.Unit.Pixel(205);
               }).Bind(ViewBag.nsrsbh).GetHtml()
                </td>
            </tr>
        </table>
        @Html.Partial("QueryAllowancePayListPartial", Model)
        @Html.Hidden("hnsrsbh", "");
        @Html.Hidden("hnsrbm", "");
        @Html.Hidden("hnsrmc", "");
        @Html.Hidden("hFFinance", "");
        @Html.Hidden("hFAmount1", "");
        @Html.Hidden("hFAmount2", "");                                                                                            
        @Html.Hidden("hFFileNo", "");
        @Html.Hidden("hFNote", "");
        @Html.Hidden("hFPayDateBegin", "");
        @Html.Hidden("hFPayDateEnd", "");
                                        @Html.Hidden("hsearched", "F")

    }
</body>
</html>
